/**
 * @author zhaozeyang
 * @date 2018/11/7 20:19
 * @description
 */
public class 七十 {

    public static void main(String[] args) {
        System.out.println(a(10));
        System.out.println(b(10));
    }

    private static int b(int n) {
        if (n == 1) {
            return 1;
        }
        if (n == 2) {
            return 2;
        }
        int a = 1;
        int b = 2;
        int tmp=0;
        for (int i = 3; i <= n; i++) {
            tmp = a + b;
            a = b;
            b = tmp;
        }
        return tmp;
    }

    private static int a(int n) {
        if (n == 1) {
            return 1;
        }
        if (n == 2) {
            return 2;
        }
        return a(n - 1) + a(n - 2);
    }
}
